import threading
import time


threadLock = threading.Lock()
class MyThread(threading.Thread):
    def __init__(self,threadId,threadName,count):
        threading.Thread.__init__(self)
        self.threadId = threadId
        self.threadName = threadName
        self.count = count

    def run(self):
        threadLock.acquire()
        print(f'线程id{self.threadId},线程名{self.threadName}')
        aa(self.count,self.threadName)
        threadLock.release()

def aa(count,threadName):
    for i in range(count):
       print(f'{threadName}:   {i}')
       time.sleep(0.2)
